package kr.hkit.androidcomplete01.ch04;

import kr.hkit.androidcomplete01.R;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

public class ButtonAndEditEx extends Activity {
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.ch04_buttonandeditex);
		
		Button btn = (Button) findViewById(R.id.btn);
		btn.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				EditText et = (EditText) findViewById(R.id.edit);
				String text = et.getText().toString();
				Toast.makeText(getApplicationContext(), text, Toast.LENGTH_LONG).show();
			}
		});
	}
}
